import wuwuImage from '@/assets/img/wuwu.jpeg'
import waokuImage from '@/assets/img/waoku.jpg'
import { ref } from 'vue'

let flag = ref(true)
const mySwitch = () => {
  const pre_box = document.querySelector('.pre-box') as HTMLElement
  const img = document.querySelector("#avatar") as HTMLImageElement
  if (flag.value) {
    pre_box.style.transform = "translateX(100%)"
    pre_box.style.backgroundColor = "#c9e0ed"
    img.src = wuwuImage
  }
  else {
    pre_box.style.transform = "translateX(0%)"
    pre_box.style.backgroundColor = "#edd4dc"
    img.src = waokuImage
  }
  flag.value = !flag.value
}
export default mySwitch
